/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * dashboard.java
 *
 * Created on 8 Mar, 2013, 10:43:21 AM
 */
package employeepayrollsystem;


import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JMenu;
import javax.swing.JMenuItem;


/**
 *
 * @author DON IS ON
 */
public class dashboard extends javax.swing.JPanel implements ActionListener,ItemListener{
    
    String m="Master";
        String em="Employee";
        String cat="Category";
        String dep="Department";
        String ad="Add";
        String del="Delete";
        String ed="Edit";
        JMenu master;
        JMenu employee;
        JMenu category;
        JMenu department;
        JMenuItem add;
        JMenuItem delete;
        JMenuItem edit;
        JMenuItem emadd;
        JMenuItem emdelete;
        JMenuItem emedit;
        JMenuItem catadd;
        JMenuItem catdelete;
        JMenuItem catedit;
    /** Creates new form dashboard */
    public dashboard() {
        initComponents();
        EmployeePayrollSystemView.jDesktopPane1.add(this);
        
        master=new JMenu(m);
        employee=new JMenu(em);
        category=new JMenu(cat);
        department=new JMenu(dep);
        add=new JMenuItem(ad);
        delete=new JMenuItem(del);
        edit=new JMenuItem(ed);
        emadd=new JMenuItem(ad);
        emdelete=new JMenuItem(del);
        emedit=new JMenuItem(ed);
        catadd=new JMenuItem(ad);
        catdelete=new JMenuItem(del);
        catedit=new JMenuItem(ed);
        master.add(employee);
        master.add(category);
        master.add(department);
        employee.add(emadd);
        employee.add(emdelete);
        employee.add(emedit);
        category.add(catadd);
        category.add(catedit);
        category.add(catdelete);
        department.add(add);
        department.add(edit);
        department.add(delete);
        EmployeePayrollSystemView.menuBar.add(master);
        EmployeePayrollSystemView.menuBar.repaint();
        emadd.addActionListener(this);
        catadd.addActionListener(this);
        catdelete.addActionListener(this);
        add.addActionListener(this);
        delete.addActionListener(this);
    }
    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setAutoscrolls(true);
        setName("Form"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

                
        
    public void actionPerformed(ActionEvent e) {
        
    
        
        if(e.getSource().equals(emadd))
        {
            addemployeee ad=new addemployeee();
            ad.setBounds(40,40, 1000, 620);
            this.add(ad);
            EmployeePayrollSystemView.jDesktopPane1.repaint();
        }
        else if(e.getSource().equals(catadd))
        {
            addcategory ac=new addcategory();
            ac.setBounds(50,50,500,500);
            this.add(ac);
            EmployeePayrollSystemView.jDesktopPane1.repaint();
        }
        
       else if(e.getSource().equals(catdelete))
        {
            
            deletecategory dc=new deletecategory();
            dc.setBounds(50,50,500,500);
            this.add(dc);
            EmployeePayrollSystemView.jDesktopPane1.repaint();
        }
        
         else if(e.getSource().equals(add))
        {
            
            adddepartment addept=new adddepartment();
            addept.setBounds(50,50,500,500);
            this.add(addept);
            EmployeePayrollSystemView.jDesktopPane1.repaint();
        }
        
         else if(e.getSource().equals(delete))
        {
            
            deletedepartment deldept=new deletedepartment();
            deldept.setBounds(50,50,500,500);
            this.add(deldept);
            EmployeePayrollSystemView.jDesktopPane1.repaint();
        }
        
        
        
        
    }

    public void itemStateChanged(ItemEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
        
    }
}




